<template>
  <el-container>
    <!--顶部区域-->
    <el-header>
      <h1>房屋租赁系统管理平台
        <el-link href="/login" target="_blank" id="link" :underline="false">登录</el-link>
      </h1>
    </el-header>

    <el-container class="layout-body">
      <!--左侧边栏-->
      <el-aside width="200px">
        <!--默认激活的菜单项，配置为当前显示的视图的URL-->
        <el-menu
            :router="true"
            :default-active="$router.currentRoute.path"
            class="el-menu-vertical-demo"
            text-color="#fff"
            background-color="#101f65"
            active-text-color="#ffd04b">
          <el-menu-item index="/sys-admin/index">
            <i class="el-icon-s-home"></i>
            <span>首页</span>
          </el-menu-item>

          <el-submenu index="2">
            <template slot="title">
              <i class="el-icon-s-tools"></i>
              <span>系统管理</span>
            </template>
            <el-menu-item index="/sys-admin/admin/add-new">
              <i class="el-icon-circle-plus"></i>
              <span>添加管理员</span>
            </el-menu-item>
            <el-menu-item index="/sys-admin/admin/list">
              <i class="el-icon-s-operation"></i>
              <span>管理员列表</span>
            </el-menu-item>
            <el-menu-item index="/sys-admin/role/add-new">
              <i class="el-icon-circle-plus"></i>
              <span>添加角色</span>
            </el-menu-item>
            <el-menu-item index="/sys-admin/role/list">
              <i class="el-icon-s-operation"></i>
              <span>角色列表</span>
            </el-menu-item>
          </el-submenu>

          <el-submenu index="3">
            <template slot="title">
              <i class="el-icon-s-home"></i>
              <span>房源管理</span>
            </template>
            <el-menu-item index="/sys-admin/house/add-new">
              <i class="el-icon-circle-plus"></i>
              <span>添加房源</span>
            </el-menu-item>
            <el-menu-item index="/sys-admin/house/list">
              <i class="el-icon-s-operation"></i>
              <span>房源列表</span>
            </el-menu-item>
          </el-submenu>


        <el-submenu index="4">
          <template slot="title">
            <i class="el-icon-s-home"></i>
            <span>房源管理</span>
          </template>
          <el-menu-item index="/sys-temp/picture/add-new">
            <i class="el-icon-circle-plus"></i>
            <span>添加图片</span>
          </el-menu-item>
          <el-menu-item index="/sys-admin/house/list" disabled>
            <i class="el-icon-s-operation"></i>
            <span>图片列表</span>
          </el-menu-item>
        </el-submenu>
        </el-menu>

      </el-aside>

      <!--main-->
      <el-main>
        <!-- router-view标签表示：根据URL不同，加载对应的视图组件 -->
        <router-view/>
      </el-main>
    </el-container>
  </el-container>
</template>

<script>
export default {
  name: "HomeView",
}
</script>

<style>
.layout-body{
  position: absolute;
  top: 60px;
  bottom: 0;
  left: 0;
  right: 0;
}

#link{
  font-size: 23px;
  float: right;
  right:90px;
  color: #fff;
}

.el-header {
  background-color: #17a9a9;
  text-align: left;
}
.el-header h1{
  color: #fff;
  line-height: 60px;
}

.el-aside {
  background-color: #101f65;
  color: #fff;
  text-align: left !important;
}

.el-menu-item i, .el-submenu__title i{
  color: #fff !important;
}

.el-main {
  /*background-color: #E9EEF3;*/
  color: #333;
  text-align: center;
}

body > .el-container {
  margin-bottom: 40px;
}

.el-container:nth-child(5) .el-aside,
.el-container:nth-child(6) .el-aside {
  line-height: 260px;
}

.el-container:nth-child(7) .el-aside {
  line-height: 320px;
}
</style>